<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()"
	width="956" height="460" styleName="mainAreaModule"
	xmlns:comp="main.br.org.indt.ndg.ui.component.powerdatagrid.*"
	xmlns:render="main.br.org.indt.ndg.ui.component.renderes.*">


	<mx:Script source="../../../controller/main/ResultListController.as" />

	<mx:HBox width="100%" styleName="functionalitiesBar">
		<mx:Button height="43" width="63" click="showSurveys(event)"
			label="{ConfigI18n.getInstance().getString('btnDetailsBack')}">
			<mx:icon>@Embed(source='../../../../../../../resources/images/SETA_BACK_TRANSP.png')</mx:icon>
		</mx:Button>		
		<mx:VBox verticalAlign="middle" verticalGap="0">
			<mx:HBox verticalAlign="middle" horizontalGap="4">
				<mx:Label text="{ConfigI18n.getInstance().getString('lblResultsSurveyTitle')}" styleName="darkTitle"/>
				<mx:Label id="surveyTitle" styleName="darkTitle" maxWidth="300"/>
			</mx:HBox>
			<mx:HBox verticalAlign="middle" horizontalGap="2">
				<mx:Button label="{ConfigI18n.getInstance().getString('btnResultsMap')}" height="22" id="btnMap" width="70"
					click="showMap()"/>
				<mx:Button label="{ConfigI18n.getInstance().getString('btnResultsMapAll')}" height="22" id="btnMapAll" width="70"
					click="showMapAll()"/>
				<mx:Button label="{ConfigI18n.getInstance().getString('btnResultsExport')}" height="22" id="btnExport"
					click="export()" width="70"/>
				<mx:Button label="{ConfigI18n.getInstance().getString('btnResultsImport')}" height="22" id="btnImport"
					click="showImport()" width="70"/>
			</mx:HBox>
		</mx:VBox>
		<mx:HRule width="100%" visible="false"/>
		<comp:PowerSearch id="search" optionsLabels="{searchOptionsLabels}" optionsFields="{searchOptionsFields}"
			searchLabel="{ConfigI18n.getInstance().getString('lblSearch')}"/>
	</mx:HBox>

	<mx:HBox width="100%" height="100%" horizontalGap="2">
		<mx:VBox width="100%" height="100%" styleName="gridPanel">
			<mx:DataGrid id="resultsGrid" dataProvider="{resultList}" height="100%" change="showPreview(event)"
					itemClick="pagination.itemClick(resultsGrid.selectedItem)">
				<mx:columns>
					<render:CheckBoxHeaderColumn dataField="selected"
						id="customCheck" width="25" sortable="false"
						headerRenderer="main.br.org.indt.ndg.ui.component.renderes.CheckBoxRenderer"
						itemRenderer="main.br.org.indt.ndg.ui.component.renderes.CheckBoxRenderer" />
					<mx:DataGridColumn headerText="{ConfigI18n.getInstance().getString('colResultId')}"
						dataField="idResult" width="70"/>
					<mx:DataGridColumn headerText="{ConfigI18n.getInstance().getString('colResultTitle')}"
						dataField="title" sortable="false" width="200"/>
					<mx:DataGridColumn headerText="{ConfigI18n.getInstance().getString('colDate')}"
						dataField="date" sortable="false" width="80"/>
					<mx:DataGridColumn headerText="{ConfigI18n.getInstance().getString('colUser')}"
						dataField="user" sortable="false" width="130"/>
					<mx:DataGridColumn headerText="{ConfigI18n.getInstance().getString('colImei')}"
						dataField="imei" width="130"/>
					<mx:DataGridColumn headerText="{ConfigI18n.getInstance().getString('colLocation')}"
						dataField="" sortable="false" width="69">
						<mx:itemRenderer>
							<mx:Component>
								<mx:VBox width="100%" horizontalAlign="center">
									<mx:Image source="main/resources/images/MAP_STATUS_OK.png" mouseEnabled="true" buttonMode="true"
										visible="{data.lat != 0 || data.lon != 0}" toolTip="[{data.lat},{data.lon}]"/>
								</mx:VBox>
							</mx:Component>
						</mx:itemRenderer>
					</mx:DataGridColumn>
				</mx:columns>
			</mx:DataGrid>
			<comp:PowerDataPagination dataProvider="{resultList}" remoteObject="{remoteListResults}"
				grid="{resultsGrid}" search="{search}"
				changePage="listResults(event)" pageSize="{RESULT_PAGE_SIZE}" checkable="true" id="pagination"
				pageLabel="{ConfigI18n.getInstance().getString('pcPageLabel')}"
				ofLabel="{ConfigI18n.getInstance().getString('pcOfLabel')}"
				refreshLabel="{ConfigI18n.getInstance().getString('pcRefreshLabel')}"
				itemsLabel="{ConfigI18n.getInstance().getString('pcItemsLabel')}"
				selectedItemsLabel="{ConfigI18n.getInstance().getString('pcSelectedItemsLabel')}"/>
		</mx:VBox>	
		
		<mx:VBox width="250" height="100%" borderStyle="none" verticalGap="1">
			<mx:ApplicationControlBar height="23" width="100%" styleName="previewCtrlBar">
				<mx:Label text="{ConfigI18n.getInstance().getString('lblPreviewPanel')}" styleName="clearText" fontWeight="bold"/>
			</mx:ApplicationControlBar>
			<mx:TextArea width="100%" height="100%" editable="false" id="preview" styleName="previewTextArea"/>	
		</mx:VBox>
	</mx:HBox>

	
</mx:Module>
